package com.group.library.order.controller.admin;

import com.group.library.order.dto.MessageBean;
import com.group.library.order.service.ReportService;
import com.group.library.order.util.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/report")
public class ReportManageController {

    @Autowired
    private ReportService reportService;

    @RequestMapping(value = "/listReport.action",method = RequestMethod.GET)
    public MessageBean findReport(Integer limit,Integer page,String name,String number){
        try{
            System.out.println("name-->"+name+" number-->"+number);
            return MessageUtil.success("查找成功！",reportService.findReport(page,limit,name,number));
        }catch(Exception e){
            e.printStackTrace();
            return MessageUtil.failure("查找失败！");
        }

    }


}
